package com.eschool.controller;

import com.eschool.pojo.ServerResult;
import com.eschool.pojo.PurchaseDAO;
import com.eschool.service.CardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Configuration
public class CardController {
    @Autowired
    CardService cardService;

    @RequestMapping("/card/stuid2purc")
    public ServerResult stuid2purc(String studentId) {
        List<PurchaseDAO> purcList = cardService.stuid2purc(studentId);
        return new ServerResult(0, "success", purcList);
    }
}